﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Common;

namespace Ex06
{
    /// <summary>
    /// A Basic Query --Translation
    /// </summary>
    class Program
    {
        static void Main(string[] args)
        {
            // With AsQueryable() added, you can see the translation to fluent syntax in the λ tab below:

            var names = new[] { "Tom", "Dick", "Harry", "Mary", "Jay" }.AsQueryable();

            IEnumerable<string> query =
                from n in names
                where n.Contains("a")    // Filter elements
                orderby n.Length            // Sort elements
                select n.ToUpper();        // Translate each element (project)

            query.Dump();
            Console.ReadKey();
        }
    }
}
